<template>
	<!-- <div>合伙人钱包明细</div> -->
	<view class="box">
		<view class="top flex" :style="{ borderRadius: '31.5rpx' }">
			<view class="income flex element" :style="{ borderRadius: '31.5rpx',backgroundColor: status === 0 ? '#FFBF60' : '#F3F3F3', 
					color: status === 0 ? 'white' : 'black'  }" @click="tabClick(0)">
				收入明细
			</view>
			<view class="income flex element" :style="{ borderRadius: '31.5rpx',backgroundColor: status === 1 ? '#FFBF60' : '#F3F3F3', 
					color: status === 1 ? 'white' : 'black'}" @click="tabClick(1)">
				支出明细
			</view>
		</view>

		<view class="mt20" v-for="(item,index) in list" :key="index">
			<view class="Recharge flex mb28">
				<view class="flex">
					<!-- <image src="https://img1.baidu.com/it/u=3034232350,1041791648&fm=253&fmt=auto&app=138&f=PNG?w=500&h=500"
						mode=""></image> -->
					<image class="mr16" src="/static/images/levelImage/money.png" mode=""></image>
					<view class="text1">
						<view class="text2">
							{{item.detailsName}}
						</view>
						<view>
							{{item.createTime}}
						</view>
					</view>
				</view>
				<view class="text3">
					¥ {{item.detailsPrice}}
				</view>
			</view>
			<up-line color="#C7C7C7"></up-line>
		</view>
	</view>


</template>

<script>
	import {
		getTransactionDetailsList
	} from "@/api/home.js"
	export default {
		data() {
			return {
				status: 0,
				list: [],
				total: 0,
				page: {
					pageNumber: 1,
					pageSize: 20
				}
			}
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			if (this.total <= this.list.length) {
				return
			}
			this.page.pageNumber++
			this.getList()
		},
		methods: {
			getList() {
				getTransactionDetailsList(this.status).then(res => {
					if (res.code === 200) {
						this.list = [...this.list, ...res.rows]
						this.total = res.total
					}
				})
			},
			tabClick(val) {
				this.status = val
				this.list = []
				this.page.pageNumber = 1
				this.getList()
			}
		}
	}
	import {
		ref,
		reactive,
		onMounted
	} from 'vue';




	// const detaliList = reactive([{
	// 		title: "合伙人推广佣金",
	// 		time: "2020-12-29 12:54:54",
	// 		amont: "168.00"
	// 	},
	// 	{
	// 		title: "合伙人推广佣金",
	// 		time: "2020-12-29 12:54:54",
	// 		amont: "168.00"
	// 	},
	// ])





	// const tabClick = (val) => {
	// 	state.status = val
	// 	getList()
	// 	// detaliList.splice(0, detaliList.length)
	// 	// switch (val) {
	// 	// 	case 1:
	// 	// 		detaliList.push({
	// 	// 			title: "合伙人推广佣金",
	// 	// 			time: "2020-12-29 12:54:54",
	// 	// 			amont: "168.00"
	// 	// 		}, {
	// 	// 			title: "合伙人推广佣金",
	// 	// 			time: "2020-12-29 12:54:54",
	// 	// 			amont: "168.00"
	// 	// 		}, )
	// 	// 		currentTab.value = val;
	// 	// 		break;
	// 	// 	case 2:
	// 	// 		detaliList.push({
	// 	// 			title: "提现",
	// 	// 			time: "2020-12-29 12:54:54",
	// 	// 			amont: "168.00"
	// 	// 		}, )
	// 	// 		currentTab.value = val;
	// 	// 		break;
	// 	// }
	// }
</script>

<style scoped lang="scss">
	.box {
		width: 750rpx;
		height: 100vh;
		background-color: #FFFFFF;
		padding: 2% 2% 0 2%;
		box-sizing: border-box;
	}

	.top {
		width: 722rpx;
		height: 63rpx;
		background-color: #F3F3F3;
	}

	// .element:hover {
	// 	background-color: #FFBF60;
	// 	color: white;
	// }

	.income {
		width: 361rpx;
		height: 63rpx;
		line-height: 63rpx;
		font-size: 30rpx;
		justify-content: center;
	}



	.Recharge {
		padding: 3% 3% 0 2%;
		box-sizing: border-box;
		justify-content: space-between;
		// background-color: red;

	}

	.flex {
		display: flex;
	}

	.text1 {
		font-size: 30rpx;
		color: #949494;
	}

	.Recharge image {
		width: 56rpx;
		height: 56rpx;
		margin-top: 0.5%;
	}

	.text2 {
		font-weight: 700;
		color: #333333;
	}

	.text3 {
		color: #FF2A2A;
	}
</style>